package KTV;
import java.util.List;
class Music {
	private String name;

	public Music() {

	}

	public Music(String name) {
		this.name = name;
	}

	public String toString() {
		return name;
	}

	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof Music)) {
			return false;
		}
		Music m = (Music) obj;
		if (this.name.equals(m.name)) {
			return true;
		} else {
			return false;
		}
	}

	public int hashCode() {
		return this.name.hashCode();
	}
	public static void show(List<Music> l){
		for (int i = 0; i < l.size(); i++) {
			System.out.print(l.get(i) + "	");
		}
	}
	public static List<Music> remove(List<Music> l,String str){
		l.remove(new Music(str));
		return l;
	}
	public static List<Music> add(List<Music> l,String str){
		l.add(new Music(str));
		return l;	
	}
	public static List<Music> top(List<Music> l,String str){
		l.remove(new Music(str));
		l.add(0,new Music(str));
		return l;
	}
	public static List<Music> go(List<Music> l,String str){
		int index=l.indexOf(new Music(str));
		l.remove(new Music(str));
		//l.remove(index-1);
		l.add(index-1,new Music(str));
		//l.add(index,l.get(index-1));
		return l;
 	}
	
}

